package com.fallsvc.common.config;

import com.fallsvc.common.utils.MailUtil;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.mail.MailProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.mail.javamail.JavaMailSender;

/**
 * @auther falls_vc
 * description:
 * @date 2025/9/26  14:51
 */
@Configuration
public class MailConfig {
    @Bean
    @ConditionalOnProperty(prefix = "spring.mail",name = "username")
    public MailUtil getMailUtil(JavaMailSender javaMailSender, MailProperties mailProperties) {
        return new MailUtil(javaMailSender,mailProperties);
    }
}
